package com.restaurant.po;

public class OrderDetail {
    private Integer id;
    private Integer orderId;
    private Integer menuItemId;
    private Integer quantity;

    // 多对一关联：订单详情对应的菜单项
    private MenuItem menuItem;

    // 构造方法
    public OrderDetail() {}

    public OrderDetail(Integer orderId, Integer menuItemId, Integer quantity) {
        this.orderId = orderId;
        this.menuItemId = menuItemId;
        this.quantity = quantity;
    }

    // Getter和Setter方法
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public Integer getOrderId() { return orderId; }
    public void setOrderId(Integer orderId) { this.orderId = orderId; }

    public Integer getMenuItemId() { return menuItemId; }
    public void setMenuItemId(Integer menuItemId) { this.menuItemId = menuItemId; }

    public Integer getQuantity() { return quantity; }
    public void setQuantity(Integer quantity) { this.quantity = quantity; }

    public MenuItem getMenuItem() { return menuItem; }
    public void setMenuItem(MenuItem menuItem) { this.menuItem = menuItem; }

    @Override
    public String toString() {
        return "OrderDetail{id=" + id + ", orderId=" + orderId +
                ", menuItemId=" + menuItemId + ", quantity=" + quantity + "}";
    }
}